package com.xiaohao.ctdemo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created with IntelliJ IDEA.
 *
 * @author 小浩
 * @date 2018-07-22 19:11
 * @package com.xiaohao.ctdemo.config
 * @description
 */
@Configuration
public class MVCConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //mail
        ///ctimage/index
        //uploader
        registry.addViewController("/").setViewName("forward:indexone.html");
        registry.addViewController("/index").setViewName("forward:indexone.html");
        registry.addViewController("/ctimage/index").setViewName("forward:/index.html");
        registry.addViewController("/ctimage/mail").setViewName("forward:/mail.html");
        registry.addViewController("/ctimage/uploader").setViewName("forward:/uploader.html");
        registry.addViewController("/ctimage/algorithm_description").setViewName("forward:/algorithm_description.html");
        registry.addViewController("/ctimage/interface").setViewName("forward:/interface.html");
        registry.addViewController("/ctimage/sample_data").setViewName("forward:/sample_data.html");
        registry.addViewController("/drug/identification").setViewName("forward:/drug_identification.html");
        registry.addViewController("/drug/index_second").setViewName("forward:/index_second.html");
        registry.addViewController("/drug/drug_mail").setViewName("forward:/drug_mail.html");

        //algorithm_description
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }
}
